package cn.demoncat.util.lang.entity.tree;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * LayTree节点
 * 
 * @author yxl
 *
 */
public class LayTreeNode implements Serializable{
 
	private static final long serialVersionUID = -5460719625370413363L;
	//id
	private String id;
	//名称
	private String name;
	//别名
	private String alias;
	//子节点集
	private List<LayTreeNode> children; 
	//URL地址
	private String href; 
	//是否展开
	private Boolean spread;
	//是否选中
	private Boolean checked;
	//选择框值
	private String checkboxValue;
	//数据类型
	private String datatype;
	//选择框样式
	private String checkboxStyle;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public List<LayTreeNode> getChildren() {
		return children;
	}
	public void setChildren(List<LayTreeNode> children) {
		this.children = children;
	}
	public String getHref() {
		return href;
	}
	public void setHref(String href) {
		this.href = href;
	}
	public Boolean getSpread() {
		return spread;
	}
	public void setSpread(Boolean spread) {
		this.spread = spread;
	}
	public Boolean getChecked() {
		return checked;
	}
	public void setChecked(Boolean checked) {
		this.checked = checked;
	}
	public String getCheckboxValue() {
		return checkboxValue;
	}
	public void setCheckboxValue(String checkboxValue) {
		this.checkboxValue = checkboxValue;
	}
	public String getDatatype() {
		return datatype;
	}
	public void setDatatype(String datatype) {
		this.datatype = datatype;
	}
	public String getCheckboxStyle() {
		return checkboxStyle;
	}
	public void setCheckboxStyle(String checkboxStyle) {
		this.checkboxStyle = checkboxStyle;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		LayTreeNode that = (LayTreeNode) o;
		return Objects.equals(id, that.id) &&
				Objects.equals(name, that.name) &&
				Objects.equals(alias, that.alias) &&
				Objects.equals(children, that.children) &&
				Objects.equals(href, that.href) &&
				Objects.equals(spread, that.spread) &&
				Objects.equals(checked, that.checked) &&
				Objects.equals(checkboxValue, that.checkboxValue) &&
				Objects.equals(datatype, that.datatype) &&
				Objects.equals(checkboxStyle, that.checkboxStyle);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id, name, alias, children, href, spread, checked, checkboxValue, datatype, checkboxStyle);
	}

	@Override
	public String toString() {
		return "LayTreeNode [id=" + id + ", name=" + name + ", alias=" + alias + ", children=" + children + ", href="
				+ href + ", spread=" + spread + ", checked=" + checked + ", checkboxValue=" + checkboxValue
				+ ", datatype=" + datatype + ", checkboxStyle=" + checkboxStyle + "]";
	}
	 
}
